<?php
if(!defined('IN_SONG')) exit('No direct script access allowed');  
/**
 * Class Home Module
 * 
 * @package         Module
 * @subpackage      Test
 * @version         0.1
 * @copyright       Song (c) 2011
 */   
class LoginController extends Controller
{
    var $name = 'Login';
                            
    function __construct() {  
        parent::__construct(); 
        //$this->Template->layout = 'ajax';   
    }   
    
    public function index() {
     echo 'sdfsd';    
    }
    
    function isSubmit()
    {
        require_once MODEL.DS.'user.php';
        $objUser = new User();
        $user = $objUser->checkLogin('diepvd1', 'abc');
        $_SESSION[NAME_SESSION_USER_SYSTEM] = $user;
        Url::redirect(null, 'admin_home');
    }
    
    function draw() { 
        $this->Template->setFile('AdminLogin', 'templates/admin/login.html'); 
        /*$arrVar = array(
            'begin-form' => $this->begin(),
            'end-form' => $this->end()
        );
        $this->Template->setVar($arrVar);*/
        
        return $this->Template->output('AdminLogin');
        $this->Template->parse('OUT', 'AdminLogin');
        return $this->Template->p('OUT');  
    }
} 
?>
